package com.stylefeng.guns.modular.housemanager.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.housemanager.service.ITblHouseService;
import com.stylefeng.guns.modular.system.dao.TblHouseMapper;
import com.stylefeng.guns.modular.system.model.TblHouse;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zl123
 * @since 2018-04-04
 */
@Service
@Transactional
public class TblHouseServiceImpl extends ServiceImpl<TblHouseMapper, TblHouse> implements ITblHouseService {

	@Override
	public boolean insert(TblHouse entity) {
	
		boolean flag = super.insert(entity);
		
		int id = entity.getId();
		entity.setHouseUser(entity.getHouseUser()+"Test");
		EntityWrapper entityWrapper = new EntityWrapper();
		entityWrapper.eq("id", id);
		
		flag = super.update(entity, entityWrapper);
		return flag;
	}
}
